Scoping Constructs in Logic Programming : Implementation Problems and their

نویسندگان

  • Gopalan Nadathur
  • Bharat Jayaraman
  • Keehang Kwon
چکیده

This paper examines the implementation issues arising from introducing universally quantiied goals and some forms of implication goals in a logic programming language. While these constructs are useful in providing a logical approach to lexical scoping, they raise new implementation problems. Since universal and existential quantiiers may appear in mixed order in goals, the uniication operation used for solving existential goals must respect this ordering. We present a solution to this problem based on a tagging of constants and variables and the use of these tags in constraining uniication. This solution is amenable to an eecient implementation and can be easily assimilated into the machinery of the Warren Abstract Machine (WAM). Implication goals require new program clauses to be introduced dynamically for the purpose of solving speciic subgoals. A naive scheme based on asserting and retracting program clauses does not suuce to solve this problem, for two reasons: First, backtracking may require reinstating programs previously in existence and bookkeeping devices are needed for achieving this eeciently. Second, implication goals surrounded by existential quantiiers may give rise to program clauses parameterized by bindings for variables. Compilation and the sharing of compiled code require a closure based representation for program clauses to be developed. We describe methods for achieving these eeects and integrate these ideas into the WAM. We also outline extensions to the resulting machine for incorporating higher-order aspects into our language. The ideas developed here provide part of the basis for an ongoing implementation of the higher-order logic programming language Prolog. This paper has been submitted for publication. Comments on its contents are welcome and may be sent to one of the authors at the indicated addresses.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Scoping Constructs in Logic Programming: Implementation Problems and Their Solution Scoping Constructs in Logic Programming: Implementation Problems and Their Solution

The inclusion of universal quanti cation and a form of implication in goals in logic programming is considered. These additions provide a logical basis for scoping but they also raise new implementation problems. When universal and existential quanti ers are permitted to appear in mixed order in goals, the devices of logic variables and uni cation that are employed in solving existential goals ...

متن کامل

Scoping Constructs in Logic Programming: Implementation Problems and their Solutions

The inclusion of universal quantification and a form of implication in goals in logic programming is considered. These additions provide a logical basis for scoping but they also raise new implementation problems. When universal and existential quantifiers are permitted to appear in mixed order in goals, the devices of logic variables and unification that are employed in solving existential goa...

متن کامل

Scoping Constructs for Software Generators

A well-known problem in program generation is scoping. When identifiers (i.e., symbolic names) are used to refer to variables, types, or functions, program generators must ensure that generated identifiers are bound to their intended declarations. This is the standard scoping issue in programming languages, only automatically generated programs can quickly become too complex and maintaining bin...

متن کامل

Representing Objects in a Logic Programming Language With Scoping Constructs

We present a logic programming language that uses implications and universal quantifiers in goals and in the bodies of clauses to provide a simple scoping mechanism for program clauses and constants. Within this language it is possible to define a simple notion of parametric module and local constant. Given this ability to structure programs, we explore how object-oriented programming, where ob...

متن کامل

Representing Objects in a Logic Programming Langueage with Scoping Constructs

We present a logic programming language that uses implications and universal quantifiers in goals and in the bodies of clauses to provide a simple scoping mechanism for program clauses and constants. Within this language it is possible to define a simple notion of parametric module and local constant. Given this ability to structure programs, we explore how object-oriented programming, where ob...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 1993